<!DOCTYPE html>

<html class="no-js">

<head>
    <meta charset="utf-8">

    <title>视频上传</title>

    <meta name="description" content="">

    <meta http-equiv="cleartype" content="on">

    <link rel="stylesheet" href="platform.css">

    <script src="jquery.js"></script>
    <script src="preview.js" ></script>


</head>

<body>

<div class="page">
    <div class="form-div" style="position: absolute;">
        <form id="reg-form" action="/file_upload" method="post" enctype="multipart/form-data">
            <h1>上传页面</h1>
            <table>
                <tr>
                    <td>标题</td>
                    <td>
                        <input name="title" placeholder="请输入标题" type="text" id="title" easyform="length:4-100;char-chinese;real-time;" message="标题长度必须为4—100位" easytip="disappear:lost-focus;theme:blue;">
                    </td>
                </tr>
                <tr>
                    <td>来源</td>
                    <td>
                        <select name="source" id="source">
                            <option value="百思不得姐">百思不得姐</option>
                            <option value="梨视频" >梨视频</option>
                            <option value="秒拍网" >秒拍网</option>
                            <option value="头条视频网" >头条视频网</option>
                            <option value="其他">其他</option>
                        </select>
                    </td>
                </tr>
                <tr id="other" style="display: none">
                    <td>其他来源</td>
                    <td>
                        <input name="other" type="text" placeholder="其他来源"  >
                    </td>
                </tr>
                <tr>
                    <td>视频地址</td>
                    <td>
                        <input name="url" type="text" id="url"  message="请输入有效的地址格式" >
                    </td>
                </tr>

                <tr >
                    <td>时长</td>
                    <td>
                        <input name="duration" type="text" placeholder="时长(格式: 00:00)"  >
                    </td>
                </tr>

                <tr>
                    <td>上传文件</td>
                    <td>
                        <input name="file" type="file" id="file"  accept="video/*,audio/*" />
                    </td>
                </tr>
                <tr>
                    <td>上传缩略图</td>
                    <td>
                        <input name="thumb" type="file" id="thumb" onchange="previewImage(this,'preview','imghead')" accept="image/*" />
                    </td>
                </tr>


            </table>

            <div class="buttons">

                <input value="提交" type="submit" style="margin-right:20px; margin-top:20px;">

                <input value="重置" type="reset" style="margin-right:45px; margin-top:20px;">

            </div>

            <br class="clear">

        </form>

    </div>
    <div id="preview" style="position: relative;top: 10px;left: 100px;">
        <img id="imghead" />

    </div>


</div>

<script>

//    $(document).ready(function () {
//        $('#reg-form').easyform();
//    });

    $("#source").change(function() {
        var val = $(this).val();
        if(val == "其他"){
            $("#other").css("display","");
        }else{
            $("#other").css("display","none");
            $("#other").val("");
        }
    })





</script>

</body>

</html>

